package com.demo.serializer;

/**
 * 序列化工厂
 *
 */
public class SerializerFactory {
    /**
     * 获取序列化
     * @param serializerType
     * @return
     */
    public static ISerializer getSerializer(SerializerType serializerType) {
        if (SerializerType.GSON == serializerType) {
            return GsonSerializer.getInstance();
        } else if(SerializerType.FST == serializerType) {
        	return FSTSerializer.getInstance();
        } else {
            throw new RuntimeException("Unsupport serializerType: " + serializerType);
        }
    }
}
